home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(status == "active" && this._x >= _root.RIGHT_BOUND)
- {
- if(_root.coral.hitTest(this._x,this._y,true) == true)
- {
- vSideOfImpact = "undetermined";
- vPixelCounter = Number(1);
- while(vSideOfImpact == "undetermined")
- {
- if(_root.coral.hitTest(this._x,Number(this._y + Number(vPixelCounter)),true) == false && Number(this._y + Number(vPixelCounter)) < _root.BOTTOM_BOUND)
- {
- vSideOfImpact = "top";
- vPixelOffset = vPixelCounter + Number(this._height) * 2;
- }
- else if(_root.coral.hitTest(this._x,Number(this._y - Number(vPixelCounter)),true) == false && _root.TOP_BOUND < Number(this._y - Number(vPixelCounter)))
- {
- vSideOfImpact = "bottom";
- vPixelOffset = vPixelCounter + Number(this._height) * 2;
- }
- vPixelCounter++;
- }
- if(vSideOfImpact == "top")
- {
- setProperty(this, _Y, Number(this._y + Number(vPixelOffset)));
- }
- else if(vSideOfImpact == "bottom")
- {
- setProperty(this, _Y, Number(this._y - Number(vPixelOffset)));
- }
- }
- }
- else if(status == "active" && this._x < _root.RIGHT_BOUND)
- {
- if(_root.recruit.diver.hitTest(this._x,this._y,false) == true && hit != true)
- {
- _root.fnTakeOxygen();
- hit = true;
- this.gotoAndPlay("takeoxygen");
- }
- else if(hit == true)
- {
- if(this._x < _root.LEFT_BOUND)
- {
- hit = false;
- this.gotoAndPlay("loop");
- }
- }
- }
- }
-